package com.hkd.common.api.enums;

/**
 * 余额变动来源
 * @author HKD
 * @date 2022/9/17 20:31
 */
public enum BalanceSource {
    //订单
    ORDER(1),
    //退货
    RETURN(2)
    ;

    private Integer code;

    BalanceSource(Integer code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
    public static BalanceSource search(Integer code){
        for (BalanceSource value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
